xen: credit2: issues in csched2_cpu_pick(), when tracing is enabled.
authorDario Faggioli <dario.faggioli@citrix.com>
Wed, 27 Jul 2016 03:09:49 +0000 (05:09 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 3 Aug 2016 13:14:08 +0000 (14:14 +0100)
commit55e6b03151971cb2b2ca7558183a9e257d6cbd03
tree862d7d45e49f07f25baa2e589bae2714c86e7655
parenta33c2a9a7831587b7648baeb1249e8c6975f5b35
xen: credit2: issues in csched2_cpu_pick(), when tracing is enabled.

In fact, when not finding a suitable runqueue where to
place a vCPU, and hence using a fallback, we either:
 - don't issue any trace record (while we should, at
   least, output the chosen pcpu),
 - risk underruning when accessing the runqueues
   array, while preparing the trace record.

Fix both issues and, while there, also a couple of style
problems found nearby.

Spotted by Coverity.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c